<?php

class Back_Model_Mapper_Classements extends Jnd_Model_Mapper_Abstract
{

    protected $_dict = array(
            "id" => "id_classement",
            "nom" => "nom",
            "prenom" => "prenom",
            "licence" => "licence",
            "sexe" => "sexe",
            "classementSimple" => "classementSimple",
            "classementDouble" => "classementDouble",
            "classementMixte" => "classementMixte",
            "moyenneSimple" => "moyenneSimple",
            "moyenneDouble" => "moyenneDouble",
            "moyenneMixte" => "moyenneMixte",
            "classementNationalSimple" => "classementNationalSimple",
            "classementNationalDouble" => "classementNationalDouble",
            "classementNationalMixte" => "classementNationalMixte",
            "classementLigueSimple" => "classementLigueSimple",
            "classementLigueDouble" => "classementLigueDouble",
            "classementLigueMixte" => "classementLigueMixte",
            "classementCodepSimple" => "classementCodepSimple",
            "classementCodepDouble" => "classementCodepDouble",
            "classementCodepMixte" => "classementCodepMixte",
            "classementSimpleAout2011" => "classementSimpleAout2011",
            "classementDoubleAout2011" => "classementDoubleAout2011",
            "classementMixteAout2011" => "classementMixteAout2011",
            "moyenneSimple2011" => "moyenneSimple2011",
            "moyenneDouble2011" => "moyenneDouble2011",
            "moyenneMixte2011" => "moyenneMixte2011",
            "lienJoueur" => "lienJoueur",
    );

    public function classementParLicence($licence) {
        $table = $this->_getTable();
        $select = new Zend_Db_Table_Select($table);
        $select->where($this->getDict("licence") . "=?", $licence);
    
        $stmt = $select->query();
        $resultats = $stmt->fetchAll();
    
        return $this->unmapArray($resultats);
    } 
}

